package com.example.demo.controller;

import com.example.demo.service.RedisStreamNetworkConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

import java.util.HashSet;

/**
 * @author vaintale
 * @date 2025/7/7
 */
@RestController
@RequestMapping("/consumer-interval")
public class ConsumerIntervalController {
    @Autowired
    @Lazy
    private RedisStreamNetworkConsumer consumer;




    @GetMapping("/restart")
    public String restartConsumer() {
        HashSet<String> strings = new HashSet<>();
        strings.add("DRL");
        strings.add("DRL_EV");
        consumer.resetConsumer(strings);
        return "Consumer restarted and reset to initial state.";
    }
}
